package com.cherrish.demo;

import com.cherrish.demo.spring.Cat;
import com.cherrish.demo.spring.Man;
import com.cherrish.demo.spring.People;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author cherrish
 * @time 2019-03-19 14:34
 * @name TestSpringApp
 * @desc:
 */
public class TestSpringApp {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Cat cat = (Cat) ctx.getBean("cat");
        cat.say();

        Man man = (Man) ctx.getBean("man");
        man.say();

        People people = (People) ctx.getBean("people");
        System.out.println(people);
    }
}
